<template>
    <div class="dd_wrap_r">
      <w-button
        @click="handleReturn"
        class="return_btn"
        type="primary"
        icon="el-icon-arrow-left"
        >上一页</w-button
      >
      <Item :detail="detail" :activity="activity"></Item>
    </div>
</template>

<script>
import Item from '../components/Item'
export default {
  name: "DistributionDetail",
  components:{Item},
  props: ["id"],
  data() {
    return {
      detail: {
        car: {},
        currentIndex: 0,
        employee: {},
        finishTime: null,
        height: 0,
        id: "",
        length: 0,
        orderTime: null,
        receiveAddress: {
          address:"",
          name:"",
          phone:""
        },
        receiveName: "heng",
        records: [],
        route: "",
        sendAddress: {
          address:"",
          name:"",
          phone:""
        },
        sendName: "",
        status: "",
        type: "",
        uid: "",
        value: 0,
        weight: 0,
        width: 0,
      },
      activity: [],
    };
  },
  methods: {
    handleReturn() {
      this.$router.push({
        name: "fenpei",
      });
    },
    // getRandomInt(min, max) {
    //    this.freight = Math.floor(Math.random() * (max - min + 1)) + min
    // },
  },
  // created(){
  //   this.getRandomInt(12,20)
  // },
  mounted() {
    console.log(this.id);
    this.$axios({
      method:"GET",
      url:"http://1.15.170.222:88/api/order/getOrderByOid/" + this.id,
    }).then((response) => {
      console.log(response);
      this.detail = response.data.data;
      this.activity = response.data.records;
    })
  },
};
</script>

<style>
.dd_wrap_r {
  padding-top: 30px;
  padding-left: 130px;
  display: flex;
  flex-direction: column;
  width: 900px;
  height: 700px;
  background-color: #fff;
}
</style>
